package com.itheima.advantagesup.entity;

import com.itheima.advantagesup.vo.UserInfoVO;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * @author zhengkai.blog.csdn.net
 * @description user
 * @date 2023-07-26
 */
@Data
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;
    private String id;
    private String loginName;
    private String password;
    private String name;
    private String email;
    private String phone;
    private String loginIp;
    private LocalDateTime loginDate;
    private LocalDateTime createDate;
    private LocalDateTime updateDate;
    private String delFlag;
    private String roleId;
    private Integer status;
    private List<String> rolename;

    public UserInfoVO getUser(){
        UserInfoVO user = new UserInfoVO();
        List<String> role = new ArrayList<>();
        role.add(roleId);
        List<String> roleName = rolename;
        user.setId(id);
        user.setLogin_name(loginName);
        user.setPassword(password);
        user.setName(name);
        user.setEmail(email);
        user.setPhone(phone);
        user.setLogin_ip(loginIp);
        user.setLogin_date(loginDate);
        user.setCreate_date(createDate);
        user.setUpdate_date(updateDate);
        user.setDel_flag(delFlag);
        user.setRole_id(role);
        user.setStatus(status);
        user.setRolename(roleName);
        return user;
    }
}